-- poisoned
-- created by zhuangsl
-- 中毒
-- 需要在描述中计算伤害，单独列出

return {
    fetchProps = function(who, status, condition)
        local props = {};
        local prop = condition["prop"] or {};

        table.insert(props, prop);

        return props;
    end,

    desc = function(who, status, condition)
        -- 获取状态描述
        local cfg = CombatStatusM.getStatusInfo(status);
        local desc = cfg.desc;

        local prop = condition["prop"] or {};

        -- 需要计算出伤害
        local floor = DungeonM.currentLayer();
        local dungeonId = DungeonM.getDungeonId();
        if dungeonId == nil then
            dungeonId = ME.user.dbase:query("currentDungeon");
        end
        local layerFix = DungeonAreaM.query(dungeonId,"layer_fix");

        local value = math.modf(floor * (60 + layerFix) * prop[3] / 60 / 1000);

        -- 最小一点
        value = math.max(1, value);

        -- 专属免疫
        local arr = PropM.combine(who, "immunity2", PropM.getPropId("poisoned"));
        if PropM.apply(arr, value) > 0 then
            value = 0;
        end

        desc = string.gsub(desc, "{value}", value);

        return desc;
    end,
};
